package com.violet.common.constant.universal;

/**
 * @Author: wqf
 * @Date: 2022/10/26
 * @Description:
 */
public interface SecurityConstants {

    /**
     *
     */
    String TOKEN_HEADER = "Authorization";

    /**
     * 用户id信息头
     */
    String USER_ID_HEADER = "x-userid-header";
    /**
     * 用户信息头
     */
    String USER_HEADER = "x-user-header";
    /**
     * 角色信息头
     */
    String ROLE_HEADER = "x-role-header";

    /**
     * 默认账号类型
     */
    String DEF_ACCOUNT_TYPE = "pc";

    /**
     * 登录后端接口地址
     */
    String LOGIN_URL = "/sys/login";

    /**
     * 登录页地址
     */
    String LOGIN_PAGE = "http://10.168.1.211:8090/login";
    /**
     * 登录成功跳转地址
     */
    String SUCCESS_FORWARD_URL = "http://10.168.1.211:8090/index";
    /**
     * 登陆失败跳转地址
     */
    String FAILURE_FORWARD_URL = "http://10.168.1.211:8090/login";
    /**
     * 退出登录地址
     */
    String LOGOUT_URL = "/sys/logout";
    /**
     * 退出登录成功跳转地址
     */
    String LOGOUT_SUCCESS_URL = "http://10.168.1.211:8090/login";

    /**
     * 授权码模式
     */
    String AUTHORIZATION_CODE = "authorization_code";
    /**
     * 刷新token
     */
    String REFRESH_TOKEN = "refresh_token";

    /**
     * oauth token
     */
    String OAUTH_TOKEN_URL = "/oauth/token";
    /**
     * 获取授权码地址tokenAuthenticationFilter
     */
    String AUTH_CODE_URL = "/oauth/authorize";

    String AUTHENTICATION = "token";

    String ACCOUNT_TYPE_PARAM_NAME = "accountType";
    /**
     * rsa公钥
     */
    String RSA_PUBLIC_KEY = "publicKey.txt";
    /**
     * 缓存client的redis key，这里是hash结构存储
     */
    String CACHE_CLIENT_KEY = "oauth_client_details";
    /**
     * 默认token过期时间(1小时)
     */
    Integer ACCESS_TOKEN_VALIDITY_SECONDS = 60 * 60;
    /**
     * redis中授权token对应的key
     */
    String REDIS_TOKEN_AUTH = "auth:";
    /**
     * redis中应用对应的token集合的key
     */
    String REDIS_CLIENT_ID_TO_ACCESS = "client_id_to_access:";
    /**
     * redis中用户名对应的token集合的key
     */
    String REDIS_UNAME_TO_ACCESS = "uname_to_access:";
}
